package com.lanou.bookstore.utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import java.sql.Connection;
import java.sql.SQLException;

public class C3p0_utils {
    private static ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource();

    public static Connection getConnection() {
        Connection connection = null;
        try {
            connection = comboPooledDataSource.getConnection();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return connection;
    }


    public static void main(String[] args) {
        Connection connection = getConnection();
        System.out.println(connection);
    }
}